import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

export const menus = [
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/home/index.vue'),
    meta: {
      title: '系统首页',
      icon: '',
    },
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/about/index.vue'),
    meta: {
      title: '关于我们',
      icon: '',
    },
  },
  {
    path: '/system',
    name: 'Aystem',
    component: () => import('@/layout/OuthLayout/index.vue'),
    meta: {
      title: '系统管理',
      icon: '',
    },
    children: [
      {
        path: '/system/user',
        name: 'About',
        component: () => import('../views/about/index.vue'),
        meta: {
          title: '用户管理',
          icon: '',
        },
      },
      {
        path: '/system/role',
        name: 'About',
        component: () => import('../views/about/index.vue'),
        meta: {
          title: '权限管理',
          icon: '',
        },
      },
      {
        path: '/system/menu',
        name: 'About',
        component: () => import('../views/about/index.vue'),
        meta: {
          title: '菜单管理',
          icon: '',
        },
      },
      {
        path: '/system/notice',
        name: 'Notice',
        component: () => import('../views/system/notice/index.vue'),
        meta: {
          title: '通知管理',
          icon: '',
        },
      },
    ],
  },
];

const routes = [
  {
    path: '/',
    redirect: '/home',
    component: () => import('../layout/BaseLayout/index.vue'),
    children: menus,
  },
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
});

export default router;
